Type Definitions
-
ExtensionPriority
-
Extension point process order.
Type:
- module:ft/core/extensions.PriorityNormal | module:ft/core/extensions.PriorityFirst | module:ft/core/extensions.PriorityLast | Number
-
forEachNodeInSetCallback(each)
-
A callback for processing each node in a set.
nodeset.forEachNodeInSet(function (eachNode) { console.log(eachNode.text()); });Parameters:
Name Type Description eachmodule:ft/core/node.Node Each node in the set.
-
forEachNodeInRangeCallback(node, line, location, length, fullySelected)
-
A callback for processing each line in a range.
range.forEachNodeInRange(function (node, line, location, length, fullySelected) { console.log(eachNode.text()); });Parameters:
Name Type Description nodemodule:ft/core/node.Node Each node.
lineNumber Line number.
locationNumber Node relative range start location.
lengthNumber Node relative range length.
fullySelectedBoolean True if the node is fully selected by the range.
-
LineChar
-
A location represented by a line number and a character offset into that line.
Type:
- Object
Properties:
Name Type Description lineNumber Zero based line number.
chNumber Zero based character offset into the line.
-
Rect
-
A rectangle.
Type:
- Object
Properties:
Name Type Description topNumber bottomNumber leftNumber rightNumber widthNumber heightNumber -
KeyMap
-
Key maps are ways to associate keys with functionality. A key map is an object mapping strings that identify the keys to functions that implement their functionality.
This editor uses the CodeMirror key map implementation with two changes:
CodeMirror keymaps pass a CodeMirror instance as the first parameter to callback functions, while FoldingText key maps pass the FoldingText editor instance.
FoldingText keymaps will first try to perform any named command declared in the FoldingText editor. If no matching command is found then commands declared at the CodeMirror level will be tried.
Type:
- Object
Properties:
Name Type Argument Description namestring <optional>
-
Command
-
Command declared in the editor using the 'com.foldingtext.editor.commands' extension point.
Type:
- Object
Properties:
Name Type Description nameString Command's name.
descriptionString Command's description.
-
TargetResult
-
Type:
- Object
Properties:
Name Type Description nodemodule:ft/core/node.Node lineChLineChar attributesObject -
RenderLineWidgetOptions
-
Options control how line widgets get displayed.
The options are the same as the options describe in CodeMirror's addLineWidget feature with two additions:
overlay- A boolean, if given a value of true then the widget will draw over the node's line instead of getting inserted before or after it.positionWidget- A function that takes widgets calculated width and heigh as parameters and returns and object with (all optional) top, bottom, left, and right style properties. This function gives the widget renderer the opportunity to precisely position the widget after the node's text has been inserted into the node's DOM element.
Type:
- Object